import request from '@/utils/request'

const api = {
  getCompanyDetail: '/manage/companyProfile/get', // 获取公司介绍详情
  updateCompanyInfo: '/manage/companyProfile/update', // 修改公司介绍

  addClient: '/manage/cooperativeCustomers/insert', // 添加合作客户
  deleteClient: '/manage/cooperativeCustomers/delete', //删除合作客户
  getClientList: '/manage/cooperativeCustomers/list', //获取合作客户列表
  updateClient: '/manage/cooperativeCustomers/update', // 修改合作客户

  getMenuTree: '/manage/menu/tree', //获取菜单树
  updateMenuTree: '/manage/menu/update', //更新菜单树
  addMenu: '/manage/menu/insert', // 新增菜单
  deleteMenu: '/manage/menu/delete', // 删除菜单

  deleteInformation: '/manage/dataDown/delete', //删除资料
  addInformation: '/manage/dataDown/insert', //新增资料
  getInformation: '/manage/dataDown/list', // 查询资料
  updateInformation: '/manage/dataDown/update', //更新资料

  deleteNews: '/manage/news/delete', // 删除新闻
  addNews: '/manage/news/insert', // 新增新闻
  getNewsList: '/manage/news/list', //新闻列表
  updateNews: '/manage/news/update', //修改新闻

  addProduct: '/manage/product/insert', // 新增产品
  deleteProduct: '/manage/product/delete', // 删除产品
  getProductList: '/manage/product/list', // 查询产品
  updatetProduct: '/manage/product/update', // 更新产品
  getProductImgs: '/manage/productImage/getProductImage', // 查询产品图片

  getHomePages: '/manage/banner/list', //获取首屏
  updateHomePages: '/manage/banner/update', // 修改首屏

  deleteUser: '/manage/user/delete', //删除用户
  addUser: '/manage/user/insert', // 新增用户
  getUserList: '/manage/user/list', // 用户列表
  resetUserPassword: '/manage/user/resetPassword', //重置密码
  updateUser: '/manage/user/update', // 修改用户
  updateUserPassword: '/manage/user/updatePassword', // 修改密码
}

export default api

export function getCompanyDetail (params) {
  return request({
    url: api.getCompanyDetail,
    method: 'get',
    params: params
  })
}
export function updateCompanyInfo (params) {
  return request({
    url: api.updateCompanyInfo,
    method: 'post',
    data: params
  })
}
export function addClient (params) {
  return request({
    url: api.addClient,
    method: 'post',
    data: params
  })
}
export function deleteClient (params) {
  return request({
    url: api.deleteClient,
    method: 'post',
    params: params
  })
}
export function updateClient (params) {
  return request({
    url: api.updateClient,
    method: 'post',
    data: params
  })
}
export function getClientList (params) {
  return request({
    url: api.getClientList,
    method: 'post',
    data: params
  })
}
export function getMenuTree (params) {
  return request({
    url: api.getMenuTree,
    method: 'post',
    data: params
  })
}
export function updateMenuTree (params) {
  return request({
    url: api.updateMenuTree,
    method: 'post',
    data: params
  })
}
export function addMenu (params) {
  return request({
    url: api.addMenu,
    method: 'post',
    data: params
  })
}

export function deleteInformation (params) {
  return request({
    url: api.deleteInformation,
    method: 'post',
    params: params
  })
}
export function addInformation (params) {
  return request({
    url: api.addInformation,
    method: 'post',
    data: params
  })
}
export function getInformation (params) {
  return request({
    url: api.getInformation,
    method: 'post',
    params: params
  })
}
export function updateInformation (params) {
  return request({
    url: api.updateInformation,
    method: 'post',
    data: params
  })
}
export function deleteNews (params) {
  return request({
    url: api.deleteNews,
    method: 'post',
    params: params
  })
}
export function addNews (params) {
  return request({
    url: api.addNews,
    method: 'post',
    data: params
  })
}
export function getNewsList (params) {
  return request({
    url: api.getNewsList,
    method: 'post',
    params: params
  })
}
export function updateNews (params) {
  return request({
    url: api.updateNews,
    method: 'post',
    data: params
  })
}
export function addProduct (params) {
  return request({
    url: api.addProduct,
    method: 'post',
    data: params
  })
}
export function deleteProduct (params) {
  return request({
    url: api.deleteProduct,
    method: 'post',
    params: params
  })
}
export function getProductList (params) {
  return request({
    url: api.getProductList,
    method: 'post',
    params: params
  })
}
export function updatetProduct (params) {
  return request({
    url: api.updatetProduct,
    method: 'post',
    data: params
  })
}
export function getProductImgs (params) {
  return request({
    url: api.getProductImgs,
    method: 'post',
    params: params
  })
}
export function getHomePages (params) {
  return request({
    url: api.getHomePages,
    method: 'post',
    params: params
  })
}
export function updateHomePages (params) {
  return request({
    url: api.updateHomePages,
    method: 'post',
    data: params
  })
}
export function deleteUser (params) {
  return request({
    url: api.deleteUser,
    method: 'post',
    params: params
  })
}
export function addUser (params) {
  return request({
    url: api.addUser,
    method: 'post',
    data: params
  })
}
export function getUserList (params) {
  return request({
    url: api.getUserList,
    method: 'post',
    params: params
  })
}
export function resetUserPassword (params) {
  return request({
    url: api.resetUserPassword,
    method: 'post',
    params: params
  })
}
export function updateUser (params) {
  return request({
    url: api.updateUser,
    method: 'post',
    data: params
  })
}
export function updateUserPassword (params) {
  return request({
    url: api.updateUserPassword,
    method: 'post',
    data: params
  })
}
export function deleteMenu (params) {
  return request({
    url: api.deleteMenu,
    method: 'post',
    params: params
  })
}
